package com.momoda.monitor.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

//https://blog.csdn.net/Colton_Null/article/details/76223388
@Configuration
@ConfigurationProperties(prefix = "ftp.monitor", ignoreUnknownFields = false)
@PropertySource("classpath:config/monitor-ftp-folder.properties")
@Data
@Component
public class MonitorFtpFolder {

//    private String rootPath;
    private String ThingJS;
    private String panos;
    private String Log;
    private String CustomModel;
    private String test;
    private String test1;
    private String interval;


//    public static void main(String[] args) throws IOException {
//        Properties properties = new Properties();
//        // 使用ClassLoader加载properties配置文件生成对应的输入流
//        InputStream in = MonitorFtpFolder.class.getClassLoader().getResourceAsStream("config/monitor-ftp-folder.properties");
//        // 使用properties对象加载输入流
//        properties.load(in);
//        //获取key对应的value值
//        properties.getProperty("monitor.ThingJS");
//        System.out.println(properties.getProperty("monitor.ThingJS"));
//    }

}
